package com.baby.springboot.consumer;

import com.sun.corba.se.spi.orbutil.threadpool.Work;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkQueuesConsumer {


    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void consumer1(String massage){
        System.out.println("这是一号："+massage);
    }

    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void consumer2(String massage){
        System.out.println("这是二号:"+massage);
    }

}
